<?php
class NoteForm extends CFormModel
{
    public $id;
    public $email;
    public $name;
    public $message;
    /**
     * Declares the validation rules.
     * The rules state that username and password are required,
     * and password needs to be authenticated.
     */
    public function rules()
    {
        return array(
            array('id,name,email,message', 'required'),
            array('email', 'email'),
            array('message', 'length','min'=>10,'max'=>2000),
            array('email','exist','allowEmpty'=>false,'attributeName'=>'email','className'=>'User'),
          //  array('id,name,email,message','required','on'=>Yii::getPathOfAlias('modules.user.backend.create')),
        );
    }

    /**
     * Declares attribute labels.
     */
    public function attributeLabels()
    {
        return array(
            'email'=>'Email',
            'message'=>Yii::t('UserModule.base','Message'),
        );
    }
}